/**
 * Copyright © 2020 易久批信息技术有限公司. All rights reserved.
 */
package com.dysm.single;

/**
 * 懒汉式进阶（双重检测锁 DCL）
 * @author xiay
 * @since 2020/12/3 9:53 下午
 */
public class DCLModel {

    private static volatile DCLModel INSTANCE = null;

    private DCLModel() {

    }

    public static DCLModel getInstance() {
        if (INSTANCE == null) {
            synchronized (DCLModel.class) {
                if (INSTANCE == null) {
                    INSTANCE = new DCLModel();
                }
            }

        }
        return INSTANCE;
    }
}
